print("异常##################################################start")


# try
def foo(s):
    return 10 / int(s)


def bar(s):
    return foo(s) * 2


def main():
    try:
        bar('0')
    except Exception as e:
        print('Error:', e)
    finally:
        print('finally...')


main()


# 抛出异常
def foo2(s):
    n = int(s)
    if n == 0:
        raise ValueError('invalid value: %s' % s)
    return 10 / n


def bar2():
    try:
        foo2('0')
    except ValueError as e:
        print('ValueError异常错误')
        raise


bar2()

print("异常##################################################end\n")
